From: Richard M. Stallman Date: Sat, 5 Jun 1993 20:58:47 +0000 (+0000) Subject: (scroll-bar-drag-1): X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~95552 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=d2ae6f7e7aef2682bdb6f5af9295898d9209339c;p=emacs.git (scroll-bar-drag-1): Calculate position relative to the accessible part of the buffer. --- diff --git a/lisp/scroll-bar.el b/lisp/scroll-bar.el index cddce3e419c..fa7e4a6d3ec 100644 --- a/lisp/scroll-bar.el +++ b/lisp/scroll-bar.el @@ -103,7 +103,10 @@ EVENT should be a scroll bar click or drag event." (portion-whole (nth 2 start-position))) (save-excursion (set-buffer (window-buffer window)) - (goto-char (scroll-bar-scale portion-whole (buffer-size))) + ;; Calculate position relative to the accessible part of the buffer. + (goto-char (+ (point-min) + (scroll-bar-scale portion-whole + (- (point-max) (point-min))))) (beginning-of-line) (set-window-start window (point)))))